<!-- 用户设置 -->
<template>
	<view class="other">
		<navigator class="set-item" :url="`/subpages/user-merchant/set/base-info/base-info?trial=${data.examineTypeData.trial}`">
			<view class="set-item-label"><text>基本信息</text></view>
			<view class="set-item-value">
				<i v-show="data.examineTypeData.trial === '0'" class="examine-type examine-ing">审核中</i>
				<i v-show="data.examineTypeData.trial === '2'" class="examine-type examine-not">审核失败</i>
				<icon class="iconfont icon">&#xe7d3;</icon>
			</view>
		</navigator>
		<navigator class="set-item" url="/subpages/user-merchant/set/phone-num/phone-num">
			<view class="set-item-label"><text>手机号</text></view>
			<view class="set-item-value">
				<i v-show="data.examineTypeData.isshowmobile === '2'" class="examine-type examine-ing">未对外展示</i>
				<icon class="iconfont icon">&#xe7d3;</icon>
			</view>
		</navigator>
		<navigator class="set-item" :url="`/subpages/user-merchant/set/wx-num/wx-num?trialwechat=${data.examineTypeData.trialwechat}`">
			<view class="set-item-label"><text>微信号</text></view>
			<view class="set-item-value">
				<i v-show="data.examineTypeData.trialwechat === '0'" class="examine-type examine-ing">审核中</i>
				<i v-show="data.examineTypeData.trialwechat === '2'" class="examine-type examine-not">审核失败</i>
				<icon class="iconfont icon">&#xe7d3;</icon>
			</view>
		</navigator>
		<navigator class="set-item" :url="`/subpages/user-merchant/set/certificate/certificate?trialcredentials=${data.examineTypeData.trialcredentials}`">
			<view class="set-item-label"><text>证书</text></view>
			<view class="set-item-value">
				<i v-show="data.examineTypeData.trialcredentials === '0'" class="examine-type examine-ing">审核中</i>
				<i v-show="data.examineTypeData.trialcredentials === '2'" class="examine-type examine-not">审核失败</i>
				<icon class="iconfont icon">&#xe7d3;</icon>
			</view>
		</navigator>
		<navigator class="set-item" url="/subpages/user-merchant/set/server-info/server-info">
			<view class="set-item-label"><text>服务信息</text></view>
			<view class="set-item-value"><icon class="iconfont icon">&#xe7d3;</icon></view>
		</navigator>
		<navigator class="set-item" url="/subpages/user-merchant/set/assist-ability/assist-ability">
			<view class="set-item-label"><text>辅助功能</text></view>
			<view class="set-item-value"><icon class="iconfont icon">&#xe7d3;</icon></view>
		</navigator>
	</view>
	<view class="info">
		<view class="set-item" @click="goAuth()">
			<view class="set-item-label"><text>账号认证</text></view>
			<view class="set-item-value"><icon class="iconfont icon">&#xe7d3;</icon></view>
		</view>
		<view class="set-item" @click="toogleRole()">
			<view class="set-item-label"><text>角色切换</text></view>
			<view class="set-item-value"><icon class="iconfont icon">&#xe7d3;</icon></view>
		</view>
	</view>
	<view class="ft"><button type="default" class="btn" hover-class="btnClickStyle" @click="loginOut()">退出登录</button></view>
</template>
<script setup>
import { ref, reactive } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import useStatus from '@/common/hooks/useStatus.js';
import config from '@/uni.config.js';
import { getMerchantExamineType } from '@/subpages/common/api/set.js';
const { loginOut, toogleRole, goAuth } = useStatus();
const avatarError = ref(false);
const data = reactive({
	examineTypeData: {}
});
//获取审核状态
async function init() {
	const res = await getMerchantExamineType();
	data.examineTypeData = res.data;
}
onShow(() => {
	init();
});

function imgError() {
	avatarError.value = true;
}
</script>
<style lang="scss">
@import '@/common/css/base.scss';
page {
	background-color: $bgColor;
}
</style>
<style scoped lang="scss">
@import '@/subpages/common/css/set.scss';
.info,
.other,
.ft {
	margin: 28rpx;
	border-radius: 16rpx;
	overflow: hidden;
	background-color: #fff;
}
.set-item {
	width: auto;
}
.set-item-value {
	.examine-type {
		width: 118rpx;
		height: 42rpx;
		line-height: 42rpx;
		font-size: 22rpx;
		text-align: center;
		color: #fff;
		border-radius: 6rpx;
	}
	.examine-ing {
		background: #ccc;
	}
	.examine-not {
		background: #ff0000;
	}
}
.ft {
	.btn {
		height: 110rpx;
		line-height: 110rpx;
		background-color: #fff;
		font-size: 32rpx;
		color: #000;
	}
}
</style>
